//
//  getJobSheetViewController.h
//  HondaPro_2
//
//  Created by glendale on 13-6-13.
//  Copyright (c) 2013年 glendale. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "subView1ForGetJobSheet.h"
#import "subView2ForGetJobSheet.h"
#import "subView3ForGetJobSheet.h"
#import "picRecodeViewController.h"
#import "subViewForResults.h"
#import "subViewForIndicationList.h"
#import "MainMenuDataModel.h"
#import "mm_subViewForPicRemarksInGetJobSheet.h"
#import "NIDropDown.h"
#import "mm_repairItemModifyViewController.h"
#import "mm_partModifyViewController.h"
#import "mm_otherChargeViewController.h"

#import "DDPopoverBackgroundView.h"
#import "popContentViewController.h"
#import "webConfig.h"
#import "webService.h"

#import "NewPopViewController.h"

#import "HelpClass.h"
#import "mm_GetTelNumberForSendMessageViewController.h"

#import "mm_addAndModifyViewController.h"

#import "mm_promoteSelPopUpViewController.h"

#import "HJRepairOrderInfoModel.h"

typedef enum {
    operationTypeAdd,
    operationTypeModify,
    operationTypeView
}operationType;

@interface getJobSheetViewController : UIViewController <NIDropDownDelegate,UITextFieldDelegate,ContentViewControllerDelegate>
{
    NIDropDown *dropDown;//下拉列表
    
    mm_subViewForPicRemarksInGetJobSheet *subViewPicRemarks;
    
    UITextView *specialTipsTextView;
    
    NSArray *arrLastStaticLblsKeys;//作业单制作界面最下边的一些静态控件关键字
    
    NSArray *arrStateButtonsKeys;//作业单制作界面最下边的状态按钮控件关键字
    NSMutableDictionary *dicStateButtonsState;//作业单制作界面最下边的状态按钮的状态 0 or 1
    NSMutableDictionary *dicStateButtons;//作业单制作界面最下边的状态按钮控件字典
    
    //作业单编辑界面中所有所有拖拽的控件 设置的tag值区间[100,140]
    NSInteger nCountOfAllPlaceViewControls;
    NSMutableArray *_arrAllPlaceViewControlsTag;
    NSMutableArray *_arrAllPlaceViewControls;//作业单编辑界面中所有拖拽的控件，都将放在这个数组中
    //作业单类型状态按钮
    bool duokehujiesuan;
    
    //功能确认
    NSArray *arrFuntionCheckKeys;
    NSDictionary *dicFunctionCheckTags;
    NSDictionary *dicFunctionCheckNumber;
    NSMutableDictionary *dicFunctionCheckBtnState;
    
    //物品确认
    NSArray *arrCarryGoodsKeys;
    NSDictionary *dicCarryGoodsTags;
    NSDictionary *dicCarryGoodsRemarks;
    NSMutableDictionary *dicCArryGoodsRemarksState;
    NSMutableDictionary *dicCarryGoodsBtnState;
    
    //修理类型
    NSArray *arrRepairTypeKeys;
    NSDictionary *dicRepairTypeTags;
    NSDictionary *dicRepairTypeTextStr;
    NSMutableDictionary *dicRepairTypeState;    
    
    popContentViewController *contentCon;
    
    NSArray *_arrForThePopViewOriginalData;
    NSMutableArray *_arrForPopTableViewDis;
    
    //估计人属性
    NSArray *_arrOriginalDataForEvaluator;
    
    NSInteger _nRowEvaluatorSel;
    
    //服务类型属性
    NSArray *_arrOriginalDataForServiceType;
   
    NSInteger _nRowServiceTypeSel;
    
    //修理种类属性
    NSArray *_arrOriginalDataForRepairType;
    
    NSInteger _nRowRepairTypeSel;
    
    //单据对象属性
    NSArray *_arrOriginalDataForDocumentBill;
    NSMutableArray *_arrDisDataForDocumentBill;
    NSInteger _nRowDocumentBillSel;
    
    mm_GetTelNumberForSendMessageViewController *_vcPopViewForSendMessage;
    //输入短信通知号码的标识
    bool _bFlagTelNumberInput;
    
    //验证标识－1保修验证；0首保验证
    NSString *_validationType;
    
    //多客户结算的messageBox
    UIAlertView *_alerVeiwForMultipleCustomerToAllocate;
    //推出界面时的messageBox
    UIAlertView *_alerVeiwForSaveJobSheetByBackBtn;
    UIAlertView *_alerVeiwForSaveJobSheetByHomeBtn;
    UIAlertView *_alertViewForMileInputWhenBack;
    UIAlertView *_alertViewForMileInputWhenHome;
    
    //车历的最高公里数
    NSString *_strMileMaxInCarThrough;
}

@property(nonatomic,assign)operationType optType;

@property (assign,nonatomic) BOOL bFlagPromoteSelPopUpView;

@property(strong, nonatomic)UIPopoverController *popCon;

@property (nonatomic,assign) IBOutlet UIScrollView *scrollView;
@property(nonatomic,strong)UIButton *HomeworkSingleNumber;//作业单制作新增按钮
@property(nonatomic,strong)UIButton *modifyForIndicationListBtn;

//作业单编辑页面的外观检查标记按钮，在该按钮上做标记
@property (strong, nonatomic) IBOutlet UIButton *picRemarkBtn;

//时间控件
@property(nonatomic,strong)UIDatePicker *datePicker;

/**
 订单详情模型
 */
@property(nonatomic,strong)HJRepairOrderInfoModel*repairOrderInfoModel;


-(IBAction)backBtn:(id)sender;
-(IBAction)homeBtn:(id)sender;
- (IBAction)picBtnSelect:(id)sender;

//下拉菜单获取数据的回调方法
-(void)getBillDocumentList:(NSNotification*)notification;
-(void)getMileMaxInCarThrough:(NSNotification *)notification;

//注册消息
-(void)addAllObserver;

//设置时间控件
-(void)setUpTheDatePicker;
//当前的时间
-(NSString *)currentDate;
//通过一个字符串给时间控件设置默认值
-(void)setUpTheDatePickerByOneDateStr:(NSString *)dateStrXingCan;
/**
 退出登录
 */
@property(nonatomic,copy)void(^returnBack)();
@end
